package cn.xq.pethome.util;

import lombok.Data;

@Data
public class AjaxResult {
  private String smg;
  private Boolean success;
  private Object data;
  private Long total;

  public AjaxResult(String smg,Boolean success){
          this.smg=smg;
          this.success=success;
  };
  public static AjaxResult success(){
          return new AjaxResult("成功",true);
  }
  public static AjaxResult error(){
    return new AjaxResult("失败",false);
  }
  public AjaxResult setmsg(String smg){
    this.smg=smg;
    return this;
  }
  public AjaxResult setdata(Object data){
    this.data=data;
    return this;
  }
  public AjaxResult settotal(Long total){
    this.total=total;
    return  this;
  }
  public AjaxResult setsuccess(Boolean success){
    this.success=success;
    return this;
  }
}
